package org.jeecg.modules.friends.dao.impl;

import java.util.List;

import org.apache.commons.collections4.CollectionUtils;
import org.jeecg.modules.friends.condition.SystemConfigCondition;
import org.jeecg.modules.friends.mapper.ext.SystemConfigDOExtMapper;
import org.jeecg.modules.friends.model.SystemConfigDO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class SystemConfigDAOImpl implements org.jeecg.modules.friends.dao.SystemConfigDAO {
    @Autowired
    private SystemConfigDOExtMapper systemConfigDOExtMapper;

    @Override
    public SystemConfigDO findOne() {
        SystemConfigCondition condition = new SystemConfigCondition();
        SystemConfigCondition.Criteria criteria = condition.createCriteria();
        criteria.andIdIsNotNull();
        List<SystemConfigDO> systemConfigDOList = systemConfigDOExtMapper.selectByCondition(condition);
        return CollectionUtils.isNotEmpty(systemConfigDOList) ? systemConfigDOList.get(0) : null;
    }
}